<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <button @click='start' :disabled="disabled">浪起来</button>
        <button @click='stop' :disabled="!disabled"> 低调</button>
        <h3>{{msg}}</h3>
    </div>
</body>
    <script>
        const vm= new Vue({
            el:'#app',
            data:{
               msg: '猥琐发育，别浪~~!',
                intervalId:null,
                disabled:false

            },
            methods:{
                start(){
                    this.disabled=true
                    this.intervalId=setInterval(()=>{
                        // console.log(this);
                        let first=this.msg.substr(0,1)
                        let end=this.msg.substr(1)
                        this.msg=end+first
                    },500)
                },
                stop(){
                    clearInterval(this.intervalId)
                    this.disabled=false
                }
            }

        })
        
    </script>
</html>